DWD Suite Publishing Notes
Publish EpanetConsoleCore
Create and Upload the EpanetConsoleCore Publish
- Open the EpanetConsoleCore solution in Visual Studio Professional (2022 or later)
- Right click on the solution and select "Publish"
- Make note of the publish output directory and confirm the publish
- Open a file explorer in the output directory
cd ..- Zip the publish directory
- Tag the zip with the version (if you've incremented the version, i.e. 1.0.2) and with the date in the format
_mmddyyy, i.e. :epanetconsolecore_v1.8.3_10302025.zip - Upload the zip to sharepoint at Documents/OH/HydroTrek/DWD/publishes/EPANETConsoleCore
Deploy the EpanetConsoleCore Publish
- Connect to GQC's VPN
- Connect to the Windows Server with Real VNC
- Download the zipped publish from sharepoint
- Replace the local published files with the new version from sharepoint
- Right click on the
epanetconsolecore.exe, go to properties, and select unblock - Open the IIS Manager and right click to stop each application pool for each hosted API
- Also in IIS Manager, right click to stop each of the hosted API sites
- Right click to start each of the application pools and sites.
Publish DwdApiAspnet
Create and Upload the DwdApiAspnet Publish
- Open the DwdApiAspnet solution in Visual Studio Professional (2022 or later)
- Right click on the solution and select "Publish"
- Make note of the publish output directory and confirm the publish
- Open a file explorer in the output directory
- Delete the appsettings.json file BEFORE zipping so that you don't overwrite the published server's settings.
cd ..- Zip the publish directory
- Tag the zip with the version (if you've incremented the version, i.e. 1.0.2) and with the date in the format
_mmddyyy, i.e. :dwd-api-aspnet_v1.8.3_10302025.zip - Upload the zip to sharepoint at Documents/OH/HydroTrek/DWD/publishes/API
Deploy the DwdApiAspnet Publish
- Connect to GQC's VPN
- Connect to the Windows Server with Real VNC
- Download the zipped publish from sharepoint
- Open the IIS Manager and right click to stop each application pool for each hosted API
- Also in IIS Manager, right click to stop each of the hosted API sites
- Replace the local published files with the new version from sharepoint
- NOTE: you will need to do this for each published instance, i.e. mtw, iitd, dnv.
- Update appsettings.json if necessary, for example to point at newly restored databases.
- Right click to start each of the application pools and sites.
Publish Database
Create DB Dump
The easiest way to create a DB dump for DWD is to utilize the script found under hydrotrek-dwd-suite/dwd-api-aspnet/Scripts/dump_db.cmd
- Open
hydrotrek-dwd-suite/dwd-api-aspnet/DwdApiAspnet/appsettings.jsonwith a text editor such as Notepad++ or VS Code. - Make sure you're referencing the database that you want to dump, i.e. mtw, iitd, or dnv.
- In a terminal, run the
hydrotrek-dwd-suite/dwd-api-aspnet/Scripts/dump_db.cmdscript which will automatically create a named db dump file in your ~/Downloads directory. - If you need to dump other databases, repeat the previous two steps to point at the new database and create its dump
- Upload all DB dumps to sharepoint at Documents/OH/HydroTrek/DWD/db_dumps/NETWORK
Create DB Dump with PSQL
If you want to use PSQL instead, or if you don't have the API source code available (such as if you want to dump the currently published database on the Windows Server), you can do so from PG Admin or the command line:
- Open a Terminal
cd Downloadspsql -U postgres mtw_5_7_2025 > mtw_5_7_2025.backup
Then, after transferring the database to your local machine, you can restore it with PG Admin or with the pg_restore command, as described in the following section.
Restore DB Dump
- Download the DB dump(s) from Sharepoint
- Create a new empty database matching the name of the dump file, i.e.
mtw_5_7_2025 - Restore the dump into the database with either
- PG Admin
- or PSQL with the command
pg_restore -U postgres -d mtw_5_7_2025 mtw_5_7_2025.backup